<template>
	<view class="two">
		<view class="bg-white padding">
			<view class="cu-steps">
				<view class="cu-item" :class="index>num?'':'text-blue'" v-for="(item,index) in numList" :key="index">
					<text class="num"  :data-index="index + 1"></text> {{item.name}}
				</view>
			</view>
		</view>
		<view class="BH5"></view>
		<view class="price">
			<view class="price-01" :class="xuan==index?'xz':'' " @click="xuanzhogn(item.id,index)"   v-for="(item,index) in list" :key="index" >
				包月
				<view class="price-01-p text-blue">¥<span>{{item.money}}</span></view>
				<text>{{item.indate}}元/天</text>
			</view>
<!-- 			<view class="price-01" :class="xuan==2?'xz':'' " @click="xuan=2">
				包季
				<view class="price-01-p">¥<span>1599</span></view>
				<text>1599元/月</text>
			</view>
			<view class="price-01" :class="xuan==3?'xz':'' " @click="xuan=3">
				包年
				<view class="price-01-p text-blue">¥<span>5999</span></view>
				<text>5999元/月</text>
			</view> -->
		</view>
		<view class="btn flex flex-direction">
			<button class="cu-btn lg bg-blue" @click="next">立即支付</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				xuan:1,
				numList: [{
					name: '提交资质'
				}, {
					name: '选择入驻方式'
				}, {
					name: '等待审核'
				},  ],
				num: 1,
				list:[]
			};
		},
		methods:{
			xuanzhong: function(e,index) {
				console.log(e)
				this.xuan = index
			},
			next(){
				//#ifdef MP-WEIXIN
				var that = this;
				this.global.request.post({
					data: {
                    type:'ruzhu',
					do:'wx_dingyue',
					},
					success: res => {
						wx.requestSubscribeMessage({
							tmplIds: ress,
							success: (res) => {
							  console.log("弹窗调起成功")
							},
							fail(err) {
							  console.log(err)
							}
						})
					}
				})
				//#endif
				uni.showToast({
					title:"提交成功",
					icon:"none"
				})
				//#ifdef H5
				api.Urltiaozhuan('do=pay&pay_type=jifen&id='+res)
				//#endif
				//#ifdef MP-WEIXIN
				this.global.request.post({
					data: {
						do:'wx_pay',
						type:'shangjia_ruzhu'
					},
					success: ress => {
						uni.requestPayment({
							'provider': 'wxpay',
							'timeStamp': ress.timeStamp,
							'nonceStr': ress.nonceStr,   //字符串随机数
							'package': ress.package,
							'signType': ress.signType,
							'paySign': ress.paySign,
							success: function (res) {
								uni.navigateTo({
									url: '/pagesA/shangjia/certification/three/three',
								});
							}
						})
					}
				})
				//#endif
			}
		},
		onLoad() {
			this.global.request.post({
				data: {
					do:'shangjia',
					op:'ruzhu_type'
				},
				success: res => {
					this.list = res
				}
			})
		}
	}
</script>

<style lang="scss">
.two{
	.BH5{background-color: #F3F5F4;height: 4px;}
	.price{display: flex;padding: 20px 10px;justify-content: space-between;
		.price-01{border: 2px solid #F8F8F8;border-radius: 3px;width: 32%;text-align: center;padding: 20px 0;font-weight: 600;
		font-size: 16px;
			.price-01-p{padding: 18px 0 13px;color: #FF5300;
				span{font-size: 20px;padding-left: 5px;}
			}
			text{color: #B0B1B5;font-size: 14px;font-weight: 500;}
		}
		.xz{border: 2px solid #FF5300;}
	}
	.H50{height: 50px;}
	.btn{position: fixed;bottom: 0; left:0;padding: 10px;width: 100%;background-color: #fff;z-index: 9;}
}
</style>
